package cn.wolfcode.wolf2world.web.controller;

import cn.wolfcode.wolf2world.web.event.SandMsgEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.event.EventListener;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 杨兴健
 * @Date 2020/8/18 10:11
 */
@RestController
public class TestController {

    @Autowired
    ApplicationContext context;
    @GetMapping("/sand")
    public String sand() {
        context.publishEvent(new SandMsgEvent("源","杨兴健","这是一个测试用例"));
        return "测试完成";
    }

}
